Component({
  properties: {
    show: {
      type: Boolean,
      value: false
    }
  },

  data: {
    inputValue: ''
  },

  methods: {
    handleInput(e) {
      let {
        value
      } = e.detail;
      this.setData({
        inputValue: value
      });
    },

    sendComment() {
      if (this.data.inputValue === '') {
        wx.showToast({
          title: '请输入内容',
          duration: 1000,
          icon: 'none'
        });
        return
      };
      this.triggerEvent('send', {
        value: this.data.inputValue
      }, {});
    },

    hide() {
      this.setData({
        show: false
      });
    }
  }
})